<!DOCTYPE html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1,shrink-to-fit=no">
    <title>下单</title>
    <link rel="icon" href="./img/login.jpg" type="img/x-ico" />
    <link href="./css/bootstrap.min.css" rel="stylesheet">
    <link href="./css/signin.css" rel="stylesheet">
    <script src="./js/jquery.js"></script>
</head>
<body class="text-center">
<!--  用户登录form表单 -->
<div class="form-signin">
<!--    <img class="mb-4" src="/img/login.jpg" width="72" height="72">-->

    <input  id="makerOrder" type="button" value="点击" class="btn btn-lg btn-primary btn-block" onclick="makerOrder('click')" />
    <input  id="store" type="button" value="收藏" class="btn btn-lg btn-primary btn-block" onclick="makerOrder('job_collect')" style="background-color: red;border-color: red;" />
    <input  id="post" type="button" value="投简历" class="btn btn-lg btn-primary btn-block" onclick="makerOrder('cv_send')" style="background-color: green;border-color: green;" />
    <input  id="uploadA" type="button" value="上传简历" class="btn btn-lg btn-primary btn-block" onclick="makerOrder('cv_upload')" style="background-color: #11130b;border-color:#11130b" />
</div>
</body>

<script>

    function makerOrder(val) {
        console.log('value >>>>>>>>',val)
		const opsJson = {
            user_id: 'user_id_0',
            act_time: new Date(),
            action: val,
            job_code: 'job_code'
        }

        $.ajax({
            url:"http://www.test.com/kafka/ops/",
            type:"POST" ,
            crossDomain: true,
            data: opsJson,
            // 下面这句话允许跨域的cookie访问
            xhrFields: {
                withCredentials: true
            },
            success:function (data,status,xhr) {
                console.log('*********** 下单返回 **********data:',data);
                alert("发送消息：'" + val + "'到kafka成功")

            },
            error:function (err) {
                console.log(err);
                alert(err.responseText);
            }
        });
    };


</script>


<style>
    .form-signin {
        width: 100%;
        max-width: 330px;
        padding: 15px;
        margin: 0 auto;
    }
    .form-signin .form-control {
        margin-top: 15px;
    }
</style>

</html>